﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MediaScraper.Common;

namespace MediaScraper.DataAccess.Entities
{
    public class ApplicationConfiguration : UniqueEntity<int>
    {
        public string InstallPath { get; set; }
        public string ShowRootPath { get; set; }
        public string MovieRootPath { get; set; }
        public string DownloadRootPath { get; set; }
        public string AdapterName { get; set; }
        private IList<string> _subtitleCultures = new List<string>();
        public IList<string> SubtitleCultures { get { return _subtitleCultures; }}

        public ApplicationConfiguration()
        {
      
        }

        public bool DownloadRootPathValid()
        {
            return !string.IsNullOrWhiteSpace(DownloadRootPath) && FileManager.DirectoryExists(DownloadRootPath);
        }

        public bool InstallPathValid()
        {
            return !string.IsNullOrWhiteSpace(InstallPath) && FileManager.DirectoryExists(InstallPath);
        }

        public bool ShowPathValid()
        {
            return !string.IsNullOrWhiteSpace(ShowRootPath) && FileManager.DirectoryExists(ShowRootPath);
        }

        public bool MoviePathValid()
        {
            return !string.IsNullOrWhiteSpace(MovieRootPath) && FileManager.DirectoryExists(MovieRootPath);
        }
    }
}
